# Batch download JavaScript and CSS library files

# Create directories
New-Item -ItemType Directory -Force -Path "js"
New-Item -ItemType Directory -Force -Path "css"

Write-Host "Starting download of JavaScript and CSS library files..." -ForegroundColor Green

# Download marked.js
Write-Host "[1/20] Downloading Marked.js..." -ForegroundColor Cyan
Invoke-WebRequest -Uri "https://cdnjs.cloudflare.com/ajax/libs/marked/9.1.2/marked.min.js" -OutFile "js/marked.min.js" -UseBasicParsing

# Download Prism CSS files
Write-Host "[2/20] Downloading Prism Tomorrow Theme CSS..." -ForegroundColor Cyan
Invoke-WebRequest -Uri "https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism-tomorrow.min.css" -OutFile "css/prism-tomorrow.min.css" -UseBasicParsing

Write-Host "[3/20] Downloading Prism Line Numbers CSS..." -ForegroundColor Cyan
Invoke-WebRequest -Uri "https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/line-numbers/prism-line-numbers.min.css" -OutFile "css/prism-line-numbers.min.css" -UseBasicParsing

Write-Host "[4/20] Downloading Prism Line Highlight CSS..." -ForegroundColor Cyan
Invoke-WebRequest -Uri "https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/line-highlight/prism-line-highlight.min.css" -OutFile "css/prism-line-highlight.min.css" -UseBasicParsing

# Download Prism Core
Write-Host "[5/20] Downloading Prism Core..." -ForegroundColor Cyan
Invoke-WebRequest -Uri "https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-core.min.js" -OutFile "js/prism-core.min.js" -UseBasicParsing

# Download Prism Plugins
Write-Host "[6/20] Downloading Prism Autoloader..." -ForegroundColor Cyan
Invoke-WebRequest -Uri "https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/autoloader/prism-autoloader.min.js" -OutFile "js/prism-autoloader.min.js" -UseBasicParsing

Write-Host "[7/20] Downloading Prism Line Numbers..." -ForegroundColor Cyan
Invoke-WebRequest -Uri "https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/line-numbers/prism-line-numbers.min.js" -OutFile "js/prism-line-numbers.min.js" -UseBasicParsing

Write-Host "[8/20] Downloading Prism Line Highlight..." -ForegroundColor Cyan
Invoke-WebRequest -Uri "https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/line-highlight/prism-line-highlight.min.js" -OutFile "js/prism-line-highlight.min.js" -UseBasicParsing

Write-Host "[9/20] Downloading Prism Toolbar..." -ForegroundColor Cyan
Invoke-WebRequest -Uri "https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/toolbar/prism-toolbar.min.js" -OutFile "js/prism-toolbar.min.js" -UseBasicParsing

Write-Host "[10/20] Downloading Prism Copy to Clipboard..." -ForegroundColor Cyan
Invoke-WebRequest -Uri "https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/copy-to-clipboard/prism-copy-to-clipboard.min.js" -OutFile "js/prism-copy-to-clipboard.min.js" -UseBasicParsing

# Download Language Support
Write-Host "[11/20] Downloading Prism JavaScript..." -ForegroundColor Cyan
Invoke-WebRequest -Uri "https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-javascript.min.js" -OutFile "js/prism-javascript.min.js" -UseBasicParsing

Write-Host "[12/20] Downloading Prism Python..." -ForegroundColor Cyan
Invoke-WebRequest -Uri "https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-python.min.js" -OutFile "js/prism-python.min.js" -UseBasicParsing

Write-Host "[13/20] Downloading Prism CSS..." -ForegroundColor Cyan
Invoke-WebRequest -Uri "https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-css.min.js" -OutFile "js/prism-css.min.js" -UseBasicParsing

Write-Host "[14/20] Downloading Prism HTML..." -ForegroundColor Cyan
Invoke-WebRequest -Uri "https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-html.min.js" -OutFile "js/prism-html.min.js" -UseBasicParsing

Write-Host "[15/20] Downloading Prism JSON..." -ForegroundColor Cyan
Invoke-WebRequest -Uri "https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-json.min.js" -OutFile "js/prism-json.min.js" -UseBasicParsing

Write-Host "[16/20] Downloading Prism SQL..." -ForegroundColor Cyan
Invoke-WebRequest -Uri "https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-sql.min.js" -OutFile "js/prism-sql.min.js" -UseBasicParsing

Write-Host "[17/20] Downloading Prism Bash..." -ForegroundColor Cyan
Invoke-WebRequest -Uri "https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-bash.min.js" -OutFile "js/prism-bash.min.js" -UseBasicParsing

Write-Host "[18/20] Downloading Prism C..." -ForegroundColor Cyan
Invoke-WebRequest -Uri "https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-c.min.js" -OutFile "js/prism-c.min.js" -UseBasicParsing

Write-Host "[19/20] Downloading Prism C++..." -ForegroundColor Cyan
Invoke-WebRequest -Uri "https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-cpp.min.js" -OutFile "js/prism-cpp.min.js" -UseBasicParsing

Write-Host "[20/20] Downloading Prism Java..." -ForegroundColor Cyan
Invoke-WebRequest -Uri "https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-java.min.js" -OutFile "js/prism-java.min.js" -UseBasicParsing

Write-Host ""
Write-Host "Download completed!" -ForegroundColor Green
Write-Host "Files saved to:" -ForegroundColor Yellow
Write-Host "  - CSS files: css/" -ForegroundColor Yellow
Write-Host "  - JS files: js/" -ForegroundColor Yellow
